﻿ 
//----------------------------------------------------------------------
// <copyright file="ShowMessage.cs" company="NTT DATA BEEN (China)">
// Copyright (c)2012 NTT DATA BEEN (China) Information Technology Co.,Ltd.
// </copyright>
// <author> lidawei </author>
// <summary>
// システム名称　　：
// モジュールＩＤ　：
// モジュール名称　：
// 機能概要　　　　：ShowMessage类 测试用
// 改訂履歴　　　　：
// 2012-05-02 新規 lidawei    Been0001   
// </summary>
//---------------------------------------------------------------------- 



namespace Ntt.NttData.Been.Management.SolutionA.Sync.Operator.BLL
{
    using Common.Log;
    using System.Reflection;

    public static class ShowMessage
    {
        // private static Monitor.FormMsg monitor = null;

        public static void Show(string tittle, string message)
        {
            LogHelper.WriteLog(LogType.Details, "DXXXX", tittle + "--" + message);
        }
        public static void Show(string message)
        {
            LogHelper.WriteLog(LogType.Details, "DXXXX", message);
        }
        
        public  static void ShowProperty(object result)
        {
            if (result == null)
            {
                Show(string.Format("{0} -- {1}:", "object", " Is null"));
            }
            else
            {
                PropertyInfo[] p = result.GetType().GetProperties();
                foreach (var item in p)
                {
                    object value = item.GetValue(result, null);

                    if (value != null)
                        Show(string.Format("{0} -- {1}:", result.GetType().Name, item.Name), value.ToString());
                }
            }
        } 

        public static void DisplayMsg(string tittle, string message)
        {
            ServiceMonitor.OnShowMessage(new ProgressEventArgs(tittle,message));
        }
    }
}
 